#pragma once
#include <string>
#include <functional>
#include <iostream>
#include "Log.hpp"
#include "Connection.hpp"

class Task
{
using func_t = std::function<void(Connection *)>;

public:
    Task() = default;
    Task(func_t func, Connection *conn)
        : _func(func), _conn(conn)
    {
    }
~Task() {}

    void operator()()
    {
        _func(_conn);
    }

private:
    Connection *_conn;
    func_t _func;
};